package com.xnyy.lottery.config;

import com.xnyy.lottery.service.TicketService;
import com.xnyy.lottery.service.ParkingSpaceService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;

/**
 * @description: 初始化配置
 * @auther: Administrator
 * @date: 2022/9/18 10:04
 */
@Slf4j
@AllArgsConstructor
@Configuration
public class InitConfig implements CommandLineRunner {
    private final ParkingSpaceService parkingSpaceService;
    private final TicketService ticketService;

    @Override
    public void run(String... args) throws Exception {
        log.info("开始-初始化车位数据");
        parkingSpaceService.init();
        log.info("结束-初始化车位数据");
        
        log.info("");
        ticketService.init();
        log.info("");
    }
}
